<template>
  <div>
    组件A: {{ $store.state.count }}
    <button @click="add">点击+3</button>

  </div>
</template>

<script>
export default {
  data () {
    return {

    }
  },
  methods: {
    add () {
      // 点击按钮触发moutations去修改state当中的count值
      this.$store.commit('addN', 3)
    }
  }
}
</script>

<style scoped>
</style>
